//Source file: E:\\projects\\graph_viewer\\graph_viewer\\drawer\\Node_Drawer.java

package graph_viewer.drawer;

import java.awt.Color;
import java.awt.Graphics2D;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.StringTokenizer;

import graph_viewer.structure.Node;
import graph_viewer.structure.Node_Position;
import graph_viewer.structure.Visual_Component;

import graph_viewer.util.Debug;

/**
	Define method to draw a node, the drawing is done by Node_Drawer_Handler in subclasses.
*/
public class Psuedo_Node_Drawer extends Basic_Node_Drawer{
	boolean has_label, has_DOI;

	public Psuedo_Node_Drawer(){
		set_has_DOI( false );
		set_has_label( false );
	}

	public Psuedo_Node_Drawer( boolean has_label, boolean has_DOI ){
		set_has_DOI( has_DOI );
		set_has_label( has_label );
	}
	
	public Psuedo_Node_Drawer( boolean has_label ){
		set_has_DOI( false );
		set_has_label( has_label );
	}
	
	public void set_has_DOI( boolean has ){
		has_DOI		= has;
	}

	public void set_has_label( boolean has ){
		has_label	= has;
	}
	
	// psuedo node dose not display label
	protected void draw_node_label( Node node, final Graphics2D g ){}	

	protected void draw_node( Node node, Graphics2D g, int k ){
		
		Node_Position	np = node.get_position();
		
		int[] location 	= np.find_location();
		
		g.setColor( PSUEDO_NODE_COLOR );
		g.fillRect( location[0], location[1], np.get_width(), np.get_height() );

		g.setColor( Color.black );
		g.drawRect( location[0], location[1], np.get_width(), np.get_height() );	
		
	}
}
